﻿using Idlesoft.Utils;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace UtilsTests
{
    
    
    /// <summary>
    ///This is a test class for MiscExtensionsTest and is intended
    ///to contain all MiscExtensionsTest Unit Tests
    ///</summary>
	[TestClass()]
	public class MiscExtensionsTest
	{


		private TestContext testContextInstance;

		/// <summary>
		///Gets or sets the test context which provides
		///information about and functionality for the current test run.
		///</summary>
		public TestContext TestContext
		{
			get
			{
				return testContextInstance;
			}
			set
			{
				testContextInstance = value;
			}
		}

		#region Additional test attributes
		// 
		//You can use the following additional attributes as you write your tests:
		//
		//Use ClassInitialize to run code before running the first test in the class
		//[ClassInitialize()]
		//public static void MyClassInitialize(TestContext testContext)
		//{
		//}
		//
		//Use ClassCleanup to run code after all tests in a class have run
		//[ClassCleanup()]
		//public static void MyClassCleanup()
		//{
		//}
		//
		//Use TestInitialize to run code before running each test
		//[TestInitialize()]
		//public void MyTestInitialize()
		//{
		//}
		//
		//Use TestCleanup to run code after each test has run
		//[TestCleanup()]
		//public void MyTestCleanup()
		//{
		//}
		//
		#endregion


		/// <summary>
		///A test for AllEquals
		///</summary>
		public void AllEqualsTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			IEnumerable<TItem> items = null; // TODO: Initialize to an appropriate value
			bool expected = false; // TODO: Initialize to an appropriate value
			bool actual;
			actual = MiscExtensions.AllEquals<TItem>(item, items);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void AllEqualsTest()
		{
			AllEqualsTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for AnyEquals
		///</summary>
		public void AnyEqualsTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			IEnumerable<TItem> items = null; // TODO: Initialize to an appropriate value
			bool expected = false; // TODO: Initialize to an appropriate value
			bool actual;
			actual = MiscExtensions.AnyEquals<TItem>(item, items);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void AnyEqualsTest()
		{
			AnyEqualsTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for FileFriendly
		///</summary>
		[TestMethod()]
		public void FileFriendlyTest()
		{
			DateTime dt = new DateTime(); // TODO: Initialize to an appropriate value
			string pattern = string.Empty; // TODO: Initialize to an appropriate value
			string expected = string.Empty; // TODO: Initialize to an appropriate value
			string actual;
			actual = MiscExtensions.FileFriendly(dt, pattern);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		/// <summary>
		///A test for Invert
		///</summary>
		public void InvertTestHelper<TKey, TValue>()
		{
			Dictionary<TKey, TValue> dictionary = null; // TODO: Initialize to an appropriate value
			Dictionary<TValue, TKey> expected = null; // TODO: Initialize to an appropriate value
			Dictionary<TValue, TKey> actual;
			actual = MiscExtensions.Invert<TKey, TValue>(dictionary);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void InvertTest()
		{
			InvertTestHelper<GenericParameterHelper, GenericParameterHelper>();
		}

		/// <summary>
		///A test for MakeArray
		///</summary>
		public void MakeArrayTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			TItem[] expected = null; // TODO: Initialize to an appropriate value
			TItem[] actual;
			actual = MiscExtensions.MakeArray<TItem>(item);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void MakeArrayTest()
		{
			MakeArrayTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for MakeEnumerable
		///</summary>
		public void MakeEnumerableTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			IEnumerable<TItem> expected = null; // TODO: Initialize to an appropriate value
			IEnumerable<TItem> actual;
			actual = MiscExtensions.MakeEnumerable<TItem>(item);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void MakeEnumerableTest()
		{
			MakeEnumerableTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for MakeList
		///</summary>
		public void MakeListTestHelper<TItem>()
		{
			TItem item = default(TItem); // TODO: Initialize to an appropriate value
			List<TItem> expected = null; // TODO: Initialize to an appropriate value
			List<TItem> actual;
			actual = MiscExtensions.MakeList<TItem>(item);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void MakeListTest()
		{
			MakeListTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for MyDepth
		///</summary>
		public void MyDepthTestHelper<TClass>()
		{
			TClass self = default(TClass); // TODO: Initialize to an appropriate value
			int expected = 0; // TODO: Initialize to an appropriate value
			int actual;
			actual = MiscExtensions.MyDepth<TClass>(self);
			Assert.AreEqual(expected, actual);
			Assert.Inconclusive("Verify the correctness of this test method.");
		}

		[TestMethod()]
		public void MyDepthTest()
		{
			MyDepthTestHelper<GenericParameterHelper>();
		}

		/// <summary>
		///A test for SafeInvoke
		///</summary>
		public void SafeInvokeTestHelper<TItem>()
			where TItem : EventArgs
		{
			EventHandler<TItem> handler = null; // TODO: Initialize to an appropriate value
			object sender = null; // TODO: Initialize to an appropriate value
			TItem args = default(TItem); // TODO: Initialize to an appropriate value
			MiscExtensions.SafeInvoke<TItem>(handler, sender, args);
			Assert.Inconclusive("A method that does not return a value cannot be verified.");
		}

		[TestMethod()]
		public void SafeInvokeTest()
		{
			Assert.Inconclusive("No appropriate type parameter is found to satisfies the type constraint(s) of TIt" +
					"em. Please call SafeInvokeTestHelper<TItem>() with appropriate type parameters.");
		}

		/// <summary>
		///A test for SafeInvoke
		///</summary>
		[TestMethod()]
		public void SafeInvokeTest1()
		{
			EventHandler handler = null; // TODO: Initialize to an appropriate value
			object sender = null; // TODO: Initialize to an appropriate value
			MiscExtensions.SafeInvoke(handler, sender);
			Assert.Inconclusive("A method that does not return a value cannot be verified.");
		}
	}
}
